package com.example.control;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/stock")
public class stockController {

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping(value = "/deduct.json")
    public String add() {
        System.out.println("扣减库存！");
        String result = restTemplate.getForObject("http://localhost:8080/order/add", String.class);
        return "扣减库存" + result;
    }
}
